package com.upb.webserver.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;

@Getter
@ToString
@AllArgsConstructor
@Slf4j
public enum PlatformEnum {
    DEVELOPER(0, "developer"),
    DEV_OPS(1, "dev_ops"),
    AUDIT(2, "audit");
//    API(3, "open api");

    private byte id;
    private String description;

    PlatformEnum(int id, String description) {
        this.id = (byte) id;
        this.description = description;
    }

    /**
     * @param id
     * @return
     */
    public static PlatformEnum getById(byte id) {
        for (PlatformEnum value : PlatformEnum.values()) {
            if (value.id == id) {
                return value;
            }
        }
        return null;
    }

    public byte getId() {
        return this.id;
    }
}
